# Contributor: Aiden Grossman <agrossman154@yahoo.com>
# Maintainer: Aiden Grossman <agrossman154@yahoo.com>
pkgname=mathjax2
pkgver=2.7.9
pkgrel=0
pkgdesc="Math formatting for the web"
url="http://www.mathjax.org/"
arch="noarch"
license="Apache-2.0"
options="!check" # no test suite
source="$pkgname-$pkgver.tar.gz::https://github.com/mathjax/MathJax/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/"

prepare() {
	cd MathJax-$pkgver
	rm -r docs test unpacked
	rm -r fonts/HTML-CSS/TeX/png
	for _format in eot otf svg ; do
		find . -type d -name "$_format" -prune -exec rm -rf {} \;
	done
	default_prepare
}

package() {
	mkdir -p "$pkgdir"/usr/share/fonts
	cp -a MathJax-$pkgver "$pkgdir"/usr/share/mathjax2
	mv "$pkgdir"/usr/share/mathjax2/fonts "$pkgdir"/usr/share/fonts/mathjax2
	ln -s /usr/share/fonts/mathjax2 "$pkgdir"/usr/share/mathjax2/fonts
}

sha512sums="
ac7b2dfc6064148e941e5ee05361467514e5f28449dbb697ff1df556968ccb71f501c4021ade285cbbb995983513669c14d9c06886a7b83a5c75fa30504fa8ab  mathjax2-2.7.9.tar.gz
"
